<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<html>
<head>
    <base href="${basePath}">  
<link rel="stylesheet" type="text/css" href="static/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="static/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="static/css/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css" href="static/css/icheck/icheck.css" />
<link rel="stylesheet" type="text/css" href="static/css/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="static/css/style.css" /> 
<title>学员管理</title>
<link href="semantic/semantic.css" rel="stylesheet" type="text/css">
<!-- jquery一定要在semantic之前导入 -->
<script src="static/js/jquery-1.12.4.js" type="text/javascript"></script>
<script src="semantic/semantic.js" type="text/javascript"></script>
<script type="text/javascript">
	function allot(){
		$('#twodel').modal('show');
	}
	
	function affirm(){
			var checkeds = $(".item-check:checked");
				//获取所有选择的id
				var ids = [];
				checkeds.each(function() {
					ids.push(this.value);
				});
				location.replace("../business/dept/delete?id=" + ids.join("&id="));
	}
	
	$(function() {
		$('.selection.dropdown').dropdown();
		$("div.checkbox").checkbox();
		var checkAll = $("#checkAll");
		var itemCheck = $(".item-check");		
		checkAll.on("change", function() {
			//获取全选框选中状态
			itemCheck.prop("checked", this.checked)
		});

		itemCheck.on("change", function() {
			//判断判断选中的个数是否和所有存在个数一样
			var checkeds = $(".item-check:checked");
			//修改checkAll的checked属性
			checkAll.prop("checked", checkeds.length == itemCheck.length);
		});			
	});
</script>
</head>
<body>
<nav class="breadcrumb">
<i class="Hui-iconfont">&#xe67f;</i>
 <a href="staff?method=forward">首页 </a><span class="c-gray en">&gt;</span>
  <a href=dept/manager>部门管理 </a><span class="c-gray en">&gt;</span>
   <a href="job">职位管理</a> <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
<form action="student?method=selectby" method="post">
	<div class="text-c"> 
		<input type="text" name="names" id="" placeholder="姓名"   value="${param.names }"  style="width:120px" class="input-text" value="${param.names }">
		是否分配
		<select name="allot"  style="width:120px;height:28px;">
		<option selected="selected" value="">请选择</option>
			<option value="1" >是</option>
			<option value="0">否</option>
		</select>
		兴趣筛选
		<select name="iteresting"  style="width:120px;height:28px;">
				<option selected="selected" value="">请选择</option>
			<%-- 	<c:forEach items="${deptlist }" var="dept">
						<option value="${dept.deptId}" ${param.depts == dept.deptId?'selected':''} >${dept.deptName }</option>
				</c:forEach> --%>
				<option value="" >..</option>
		</select>
		来源
		<select name="source"  style="width:120px;height:28px;" >
			<option selected="selected" value="">请选择</option>
			<%-- <c:forEach items="${poslist }" var="pos">
			</c:forEach> --%>
			<option value="${pos.positionId}"${param.positions==pos.positionId?'selected':'' }>${pos.positionName }</option>
		</select>
		<button name="" id="" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 查询</button>
	</div>
	</form>
	<div class="cl pd-5 bg-1 bk-gray mt-20">
	 <span class="l" id="delete">
	<a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
	 <a class="btn btn-primary radius" onclick="picture_add('添加图片','picture-add.html')" href="javascript:;" id="add"><i class="Hui-iconfont">&#xe600;</i> 添加学员</a>
	 <a href="javascript:;" onclick="allot()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量分配</a>
	 </span> 
	 <span class="r">共有数据：<strong>${allcount }</strong> 条</span> </div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort">
			<thead>
				<tr class="text-c">
					<th width="40"><input name="" type="checkbox" value="" id="checkAll"></th>
					<th width="40">姓名</th>
					<th width="40">性别</th>
					<th width="40">学历</th>
					<th width="80">地址</th>
					<th width="80">电话</th>
					<th width="80">QQ</th>
					<th width="50">父母姓名</th>
					<th width="80">父母电话</th>
					<th width="180">填表时间</th>
					<th width="180">学生来源</th>
					<th width="180">IT热爱程度</th>
					<th width="180">是否分配咨询师</th>
					<th width="130">操作</th>
				</tr>
			</thead>
			<tbody>
			<c:if test="${empty list }">
			<tr class="text-c"><th colspan="11">无记录</th></tr>
			</c:if>
			<c:forEach items="${list }" var="l">
				<tr class="text-c">
					<th><input  class="item-check" name="" type="checkbox" value="${l.staff_id}"></th>
					<th width="40">${l.student_name }</th>
					<th width="40">${l.student_sex }</th>
					<th width="40">${l.student_recode }</th>
					<th width="80">${l.student_address}</th>
					<th width="80">${l.student_phone}</th>
					<th width="80">${l.student_qq}</th>
					<th width="80">${l.student_parent}</th>
					<th width="80">${l.student_parent_phone}</th>
					<th width="180">${l.student_comedate}</th>
					<th width="180">${l.student_source_id}</th>
					<th width="180">${l.student_interesting_id}</th>
					<th width="180">${l.student_allot_id}</th>
					<th width="130"><a href="staff?method=delete&id=${l.staff_id}" >
					<span class="label label-success radius">删除</span></a>
					<a href="staff?method=update&id=${l.staff_id}" >
					<span class="label label-success radius">修改</span></a>
					<a href="staff?method=update&id=${l.staff_id}" >
					<span class="label label-success radius">分配</span></a></th>
					</c:forEach>
			</tbody>
		</table>
			<c:if test="${totalPage > 1 }">
			<div class="page">
				<a <c:if test="${page!=1}">href="staff?method=selectby&page=1${queryString}"</c:if>
					class="${page == 1?'disable':''}">首页</a> <a
					<c:if test="${page!=1}">href="staff?method=selectby&page=${page-1}${queryString}"</c:if>
					class="${page == 1?'disable':''}">上一页</a>
					<c:forEach begin="1" end="${totalPage }" var="t">
					<a href="staff?method=selectby&page=${t}${queryString}">${t }</a> 
					</c:forEach><a
					<c:if test="${page!=totalPage}">href="staff?method=selectby&page=${page+1}${queryString}"</c:if>
					class="${page == totalPage?'disable':''}">下一页</a>  <a
					<c:if test="${page!=totalPage}">href="staff?method=selectby&page=${totalPage }${queryString}"</c:if>
					class="${page == totalPage?'disable':''}">最后一页</a> <span>
					${page}/${ totalPage} </span>
			</div>
		</c:if>
	</div>
</div>
<script src="static/js/jquery-1.12.4.js" type="text/javascript"></script>
<script type="text/javascript" src="static/js/jquery.min.js"></script> 
<script type="text/javascript" src="static/js/layer.js"></script> 
<script type="text/javascript" src="static/js/WdatePicker.js"></script> 
<script type="text/javascript" src="statoc/js/jquery.dataTables.min.js"></script> 
<script type="text/javascript" src="static/js/H-ui.js"></script> 
<script type="text/javascript" src="static/js/H-ui.admin.js"></script> 
<script src="static/js/jquery-1.12.4.js" type="text/javascript"></script>
<script src="static/js/student.js" type="text/javascript"></script>

	 <div id="deptadd">
   		<iframe class="thickframe" id="thickframe" marginwidth="0" marginheight="0" frameborder="1" scrolling="no" style="width: 100%; height: 1162px;">
		
</iframe>
		<div class="thickdiv" id="thickdiv" style="width: 100%; height: 1162px;"></div>
		<div class="thickbox" id="thickbox" style="left: 450.5px; top:80px; width: 402px; height: 482px;">
		<div class="thickwrap" style="width: 760px;">
					<div class="thicktitle" id="" style="width:740"><span>添加员工</span></div>		
						<div class="thickcon" id="" style="width: 400px; height: 470px; padding-left: 20px; padding-right: 20px;">
			<div id="addressDiagDiv">
<div class="m" id="edit-cont">
			<div>
		<!-- 	<span id="xxx">x</span> -->
			</div>
		<form action="staff?method=insert" method="post">
			<table>
				<tr>
					<td>姓名</td>
					<td><input id="name" style="width:200px;height:30px;" name="name" type="text" class="text" ></td>
				</tr>
				<tr>
						<td>性别</td>
						<td><input type="radio" value="1" name="sex" checked="checked" >男<input type="radio" value="0" name="sex" value="0">女</td>
				</tr>
				<tr>
						<td>地址</td>
						<td><input style="width:200px;height:30px;" id="address"  name="address" type="text" class="text" ></td>
				</tr>
				<tr>
						<td>密码</td>
						<td><input style="width:200px;height:30px;" id="pwd"  name="pwd" type="password" class="text" ></td>
				</tr>
				<tr>
						<td>电话</td>
						<td><input  style="width:200px;height:30px;" id="phone"  name="phone" type="text" class="text" ></td>
				</tr>
					<tr>
					<td>邮箱</td>
					<td><input style="width:200px;height:30px;"  id="email"  name="email"  type="text" class="text" ></td>
				</tr>
				<tr>
						<td>职位</td>
						<td>
						<select name="position" style="width:200px;height:30px;">
						<c:forEach items="${poslist }" var="pos">
						<option value="${pos.positionId}">${pos.positionName }</option>
						</c:forEach>
						</select>
						</td>
				</tr>
				<tr>
						<td>部门</td>
						<td>
						<select name="dept" style="width:200px;height:30px;">
						<c:forEach items="${deptlist }" var="dept">
						<option value="${dept.deptId}">${dept.deptName }</option>
						</c:forEach>
						</select>
						</td>
				</tr>
				
				<tr>
					<td id="zeng"><input type="submit" value="确定新增"></td>
					<td id="qu"><input type="button" value="取消"></td>
				</tr>
			
			</table>
			</form>
	</div></div>
</div></div>
</div>

<!-- sch -->
	<div class="ui modal" id = "twodel">
			 <i class="close icon"></i>
			<div class="header">
			  分配部门
			 </div>
			<div class="image content" style="color : red"> 
			 <i class="warning circle icon"></i><p>你确定要分配所选部门</p>
			</div>
			 <div class="actions">
			  <div class="ui black deny button">
				      不
			  </div>
			<div class="ui positive right labeled icon button" onclick = "affirm()">
					     是的
				<i class="checkmark icon"></i>
				  </div>
			 </div>
	</div>
</div>


	
	
</body>
</html>